import { defineConfig } from 'vite'
import AutoImport from "unplugin-auto-import/vite"
import vue from '@vitejs/plugin-vue'
import Components from 'unplugin-vue-components/vite';
import { AntDesignVueResolver } from 'unplugin-vue-components/resolvers';
import path from 'path';
import electron from 'vite-plugin-electron'
export default defineConfig({
  base: './',
  resolve: {
    alias: {
      "@": path.resolve(__dirname, './src'),
    },
  },

  plugins: [vue(),
  electron({
    // 路径地址为后续创建的主进程入口文件
    entry: './electron/main.js',
  }),
  AutoImport({
    //安装两行后你会发现在组件中不用再导入ref，reactive等
    imports: ['vue', 'vue-router'],
    dts: "src/auto-import.d.ts",
    //ant-design-vue
    resolvers: [AntDesignVueResolver()]
  }),
  Components({
    directoryAsNamespace: true,
    resolvers: [
      AntDesignVueResolver({
        importStyle: false, // css in js
        resolveIcons: true
      }),
    ],
  }),],
})
